package com.itheima.exerciseTest.method30_39.method31;

public class Demo {
    public static void main(String[] args) {
        // 创建商店
        Storefront sf = new Storefront();

        // 创建厨师类
        Cooker c = new Cooker(sf);
        // 创建顾客类
        Foodie f = new Foodie(sf);

        // 创建厨师线程
        for (int i = 1; i <= 3; i++) {
            Thread t = new Thread(c);
            t.setName(i + "");
            t.start();
        }
        // 创建顾客线程
        for (int i = 1; i <= 3; i++) {
            Thread t = new Thread(f);
            t.setName(i + "");
            t.start();
        }

    }
}
